package com.sm.service.Impl;

import com.sm.dao.UserDao;
import com.sm.entity.UserInfo;
import com.sm.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonServiceImpl implements PersonService {

    @Autowired
    UserDao userDao;

    public List<UserInfo> informalUser()throws Exception {
        return userDao.findInformalUser();
    }

    public void formalUser(Integer uid) throws Exception {
        userDao.updateUserStatus(uid,1);
    }

    public List<UserInfo> searchUser(String name) throws Exception {
        return userDao.findUserLikeName(name,3);
    }
}
